<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/html">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="lib/jquery/jquery.min.js"></script>
    <script src="lib/vue/vue.js"></script>
    <script src="res/controller/commonController.js"></script>
    <script src="res/controller/requestController.js"></script>

</head>
<body>
<div class="container" id="login">
    <div class="form-group">
        <label>手机号</label>
        <input type="text" class="form-control" v-model="tel">
    </div>
    <div class="form-group">
        <label>密码</label>
        <input type="password" class="form-control"  v-model="pass">
    </div>
    <button type="botton" @click="doLogin()" class="btn btn-default">登录</button>
    <button type="botton" @click="getPsssword()" class="btn btn-default">加密</button>
</div>
</body>
<script>
    var login = new Vue({
        el: '#login',
        data: {
            tel: '',
            pass: '',
            desPass:'',
            request: new requestController()
        },
        mounted:function () {

        },
        // 在 `methods` 对象中定义方法
        methods: {
            doLogin: function () {
                var _self = this;
                _self.getPsssword();
                var jsonData = {};
                jsonData.countryCode = 86;
                jsonData.mobile = _self.tel;
                jsonData.password = _self.desPass;
                jsonData.channel = 1;
                jsonData.appType = 2;
                jsonData.appVersion = 100;
                _self.request.setApiName("/User/Logon/Mobile");
                _self.request.setRequest(jsonData);
                _self.request.post();
                console.log(_self.request.getResponse());
            },
            getPsssword: function () {
                var _self = this;
                console.log(_self.pass);
                var jsonData = {};
                jsonData.source = _self.pass;
                _self.request.setApiName("/Encrypt");
                _self.request.setRequest(jsonData);
                _self.request.post();
                var data = _self.request.getRequest();
                _self.desPass = data.result;
                console.log(_self.request.getResponse());
            },
        }
    })
</script>
<link rel="stylesheet" href="lib/bootstrap/bootstrap.css">
<script src="lib/bootstrap/bootstrap.js"></script>
</html>